const { Schema, model } = require("mongoose")
const { sellersModel } = require("./sellersModel")

const userSchema = new Schema({
  delete:{
    type:Boolean,
    default:false
},
  userName: String,
  userAccount: String,
  userPassWord: String,
  sellersId: {
    type: Schema.Types.ObjectId,
    ref: sellersModel
  },
  userPhone: {
    type: Number,
    match: /^\d{11}$/
  },


}, { versionKey: false })

module.exports.userModel = model("userModel", userSchema, "users")